import http from '@/service/http'
import type * as T from '@/types/api/index'
const roleApi: T.IRoleTwoApi = {
  allList(params) {
    return http.get('/admin/role/list', params)
  },
  add(data) {
    return http.post('/admin/role', data)
  },
  edit(data) {
    return http.put('/admin/role', data)
  },
  auth(data) {
    return http.put('/admin/role/menu', data)
  },
  getAuth(roleId) {
    return http.get(`/admin/menu/tree/${roleId}`)
  },
  dels(data) {
    return http.delete('/admin/role', data.ids)
  },
}

export default roleApi
